<template>
  <div class="home-container">
    <div class="center-wrapper">
      <div class="center-card">
        <div class="center-icon">
          <el-icon><Setting /></el-icon>
        </div>
        <div class="center-name">运维中心</div>
      </div>

      <div class="center-card">
        <div class="center-icon">
          <el-icon><DataBoard /></el-icon>
        </div>
        <div class="center-name">运营中心</div>
      </div>

      <div class="center-card">
        <div class="center-icon">
          <el-icon><Menu /></el-icon>
        </div>
        <div class="center-name">应用中心</div>
      </div>

      <div class="center-card">
        <div class="center-icon">
          <el-icon><User /></el-icon>
        </div>
        <div class="center-name">用户中心</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import {ref, onMounted} from 'vue'
import {
  Setting,
  DataBoard,
  Menu,
  User
} from '@element-plus/icons-vue';
import {useRoute} from "vue-router";
import {getTokenByCode} from '@/api/auth'


const {query} = useRoute()

onMounted(() => {
  if(query.hasOwnProperty("code")){
    const accessTokenResp = getTokenByCode(query.code);
    console.info("accessToken", accessTokenResp)
  }
})

</script>

<style lang="scss" scoped>
$card-bg: #e6f7ff;
$card-hover-bg: #ccf0ff;
$text-dark: #333333;
$icon-primary: #1890ff;
$icon-hover: #0c75d8;
$cursor: pointer;

.home-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background-color: #ffffff;
}

.center-wrapper {
  width: 1024px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 2rem;
}

.center-card {
  background: $card-bg;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 150, 255, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: $cursor; // 显式设置鼠标样式

  &:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
    background: $card-hover-bg;
  }
}

.center-icon {
  font-size: 3rem;
  color: $icon-primary;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.center-card:hover .center-icon {
  color: $icon-hover;
  transform: scale(1.1);
}

.center-name {
  font-size: 1.5rem;
  color: $text-dark;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s ease;
  cursor: $cursor; // 显式设置文字上的鼠标样式
}

.center-card:hover .center-name {
  color: $icon-hover;
}
</style>
